package com.chixing.ih.module.task.mapper.provider;

import com.chixing.ih.module.task.pojo.AcceptTask;
import com.chixing.ih.util.EmptyUtil;
import org.apache.ibatis.jdbc.SQL;

/**
 * 目的:
 *
 * @author ：zcw
 * @version: 1.0  2020/9/25 20:04
 */
public class AcceptTaskMapperProvider {

    public String getOne() {
        return new SQL() {{

        }}.toString();
    }

    public String findAll() {
        return new SQL() {{

        }}.toString();
    }


    public String findCount() {
        return new SQL() {{
            SELECT("count(*)");
            FROM("tbl_receive_task");
            WHERE("task_id = #{taskId}");
        }}.toString();
    }

    public String updateOne(AcceptTask acceptTask) {
        return new SQL() {{
            UPDATE("tbl_receive_task");
            if (!EmptyUtil.isEmpty(acceptTask.getReceiveTaskStatus())) {
                SET("receive_task_status=#{receiveTaskStatus}");
            }
            WHERE("task_id=#{taskId}");
            AND().WHERE("receive_task_user_id = #{receiveTaskUserId}");

        }}.toString();
    }
}
